<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<title>MyWebSite</title>
<style type="text/css">
	html{height:100%}
	body{height:100%;margin:0px;padding:0px}
	#container{height:90%}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
<title>Insert title here</title>
</head>
<body>
	<jsp:useBean id="coordinateTran" scope="request" class="bean.coordinateTran" />
	<div id="container" style=" border:1px solid gray"></div>
	<div id="info"></div>
	<script type="text/javascript">
		var map = new BMap.Map("container"); // 创建地图实例
		var point = new BMap.Point(116.404, 39.915); // 创建点坐标
		map.enableScrollWheelZoom();   //启动鼠标中键控制地图缩放  
		map.centerAndZoom(point, 15); // 初始化地图，设置中心点坐标和地图级别
		map.enableContinuousZoom();    // 开启连续缩放效果
		map.enableInertialDragging(); // 开启惯性拖拽效果
		
		map.addControl(new BMap.NavigationControl()); // 添加控件
		map.addControl(new BMap.ScaleControl());
		map.addControl(new BMap.OverviewMapControl());  
		//map.addControl(new BMap.MapTypeControl());
		
		var marker = new BMap.Marker(new BMap.Point(116.404, 39.915));  // 创建标注
		map.addOverlay(marker);              // 将标注添加到地图中
		
		//点击鼠标获取当前坐标
		map.addEventListener("click", function(e){
			  document.getElementById("info").innerHTML = e.point.lng + ", " + e.point.lat;
			  session.setAttribute("lng",e.point.lat);
			  session.setAttribute("lat",e.point.lat);
		});


	</script>
</body>
</html>